<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.bg{background-color: #CFF;
    background-repeat:no-repeat;
	width:730px;
    }
td{font-size:12px;
   line-height:25px;
   text-align:center;
    }
</style>
<title>全选</title>
<script type="text/javascript">
function check(){
	var oInput=document.getElementsByName("product");
	for(var i=0; i<oInput.length;i++){
		if(document.getElementById("all").checked==true){
			oInput[i].checked=true;
		}
		else{
			oInput[i].checked=false;
		}
	}
}

function test(){
	var oInput=document.getElementsByName("product");
	var temp=true;
	for(var i=0;i<oInput.length;i++){
		if(oInput[i].checked==false){
			temp=false;
			break;
		}
	}
	if(temp==true){
		document.getElementById("all").checked=true;
	}
	else{
		document.getElementById("all").checked=false;
	}
	
}
</script>
</head>

<body>
<select name"">
<option value="index.html">豪华大套餐</option>
<option value="1">快餐</option>
<option value="2">点心</option>
</select>
<table border="0" cellspacing="0" cellpadding="0" class="bg">
<form action="" method="get">
    <tr>
       <td style="line-height:40px;">&nbsp;</td>
    </tr>
    <tr style="font-weight:bold">
       <td><input name="" type="checkbox" value="全选" id="all" onclick="check()" />全选</td>
       <td>美食</td>
       <td>介绍</td>
       <td>价格</td>
    </tr>
    <tr>
       <td colspan="4"><hr style="border:#666 1px dashed" /></td>
    </tr>
    <tr>
       <td><input name="product" type="checkbox" value="" /></td>
       <td><img src="images/1.jpg" width="128" height="118" /></td>
       <td>一看就知道很好吃</td>
       <td>999</td>
    </tr>
    <tr>
       <td colspan="4"><hr style="border:#666 1px dashed" /></td>
    </tr>
    <tr>
       <td><input name="product" type="checkbox" value="" /></td>
       <td><img src="images/2.jpg" width="128" height="118" /></td>
       <td>一看就知道很好吃</td>
       <td>999</td>
    </tr>
    <tr>
       <td colspan="4"><hr style="border:#666 1px dashed" /></td>
    </tr>
    <tr>
       <td><input name="product" type="checkbox" value="" /></td>
       <td><img src="images/3.jpg" width="128" height="118" /></td>
       <td>一看就知道很好吃</td>
       <td>999</td>
    </tr>
    <tr>
       <td colspan="4"><hr style="border:#666 1px dashed" /></td>
    </tr>
        <tr>
       <td><input name="product" type="checkbox" value="" /></td>
       <td><img src="images/4.jpg" width="120" height="92" /></td>
       <td>一看就知道很好吃</td>
       <td>999</td>
    </tr>
    <tr>
       <td colspan="4"><hr style="border:#666 1px dashed" /></td>
    </tr>

</table>
<input name="" type="button" value="加入购物车"  />
<input name="" type="button" value="购买"  />
    
</body>
</html>
